import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';


class AccountTextField extends StatelessWidget {
  const AccountTextField({
    super.key,
    this.controller,
    this.focusNode,
    this.prefix,
    this.hintText,
    this.hintStyle,
    this.onChanged,
    this.onEditingComplete,
    this.onSubmitted,
    this.keyboardType,
    this.adjustPadding,
    this.autofillHints,
  });

  final TextEditingController? controller;
  final FocusNode? focusNode;
  final Widget? prefix;
  final String? hintText;
  final TextStyle? hintStyle;
  final ValueChanged<String>? onChanged;
  final VoidCallback? onEditingComplete;
  final ValueChanged<String>? onSubmitted;
  final TextInputType? keyboardType;
  final double? adjustPadding;
  final Iterable<String>? autofillHints;

  @override
  Widget build(BuildContext context) {
    return TextField(
      controller: controller,
      focusNode: focusNode,
      keyboardType: keyboardType,
      textInputAction: TextInputAction.done,
      style: TextStyle(
        fontSize: 15.w,
        color: Colors.black,
      ),
      decoration: InputDecoration(
        border: InputBorder.none,
        contentPadding: EdgeInsets.only(top: adjustPadding ?? 11.w),
        focusedBorder: UnderlineInputBorder(
          borderSide: BorderSide(
            color: const Color(0XFFECECEC),
            width: 0.5.w,
          ),
        ),
        enabledBorder: UnderlineInputBorder(
          borderSide: BorderSide(
            color: const Color(0XFFECECEC),
            width: 0.5.w,
          ),
        ),
        prefixIcon: SizedBox(
          height: 30.w,
          child: prefix,
        ),
        hintText: hintText,
        hintStyle: hintStyle,
      ),
      onChanged: onChanged,
      onEditingComplete: onEditingComplete,
      onSubmitted: onSubmitted,
      autofillHints: autofillHints,
    );
  }
}
